package creational.property.copy.shallow;

public class Client {

    public static void main(String[] args) {
        MonkeyC pMonkey = new MonkeyC();
        pMonkey.setName("猴子1");
        pMonkey.setAge("2");
        Club club = new Club();
        club.setLength(100);
        club.setDiameter(20);
        pMonkey.setClub(club);
        System.out.println(pMonkey.toString());

        MonkeyC pMonkeyCopy = (MonkeyC) pMonkey.clone();
        System.out.println(pMonkey.toString());

        System.out.println("两只猴子是否是同一个对象？" + (pMonkey == pMonkeyCopy));
        System.out.println("两只猴子的棍子是否是同一个对象？" + (pMonkey.getClub() == pMonkeyCopy.getClub()));

    }

}
